import type { RouteRecordRaw } from 'vue-router'

// 基础路由配置
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: '系统首页',
    component: () => import('@/views/home/index.vue'),
    meta: {
      title: '首页',
      requiresAuth: false,
      showHeader: true,
      showInHeaderMenu: true,
      order: 1
    },
  },
  {
    path: '/company-profile',
    name: '公司概况',
    component: () => import('@/views/company-profile/index.vue'),
    meta: {
      title: '公司概况',
      requiresAuth: false,
      showHeader: true,
      showInHeaderMenu: true,
      order: 2
    }
  },
  {
    path: '/news-and-activity',
    name: '新闻与活动',
    component: () => import('@/views/news-and-activity/index.vue'),
    meta: {
      title: '新闻与活动',
      requiresAuth: false,
      showHeader: true,
      showInHeaderMenu: true,
      order: 3
    }
  },
  {
    path: '/solutions-and-services',
    name: '解决方案与服务',
    component: () => import('@/views/solutions-and-services/index.vue'),
    meta: {
      title: '解决方案与服务',
      requiresAuth: false,
      showHeader: true,
      showInHeaderMenu: true,
      order: 4
    }
  },
  {
    path: '/about-us',
    name: '关于我们',
    meta: {
      title: '关于我们',
      requiresAuth: false,
      showHeader: true,
      showInHeaderMenu: true,
      order: 5,
    },
    children: [
      {
        path: 'contact-us',
        name: '联系我们',
        component: () => import('@/views/contact-us/index.vue'),
        meta: {
          title: '联系我们',
          requiresAuth: false,
          showHeader: true,
          showInHeaderMenu: false,
          order: 1,
        }
      },
      {
        path: 'join-us',
        name: '加入我们',
        component: () => import('@/views/join-us/index.vue'),
        meta: {
          title: '加入我们',
          requiresAuth: false,
          showHeader: true,
          showInHeaderMenu: false,
          order: 2,
        }
      }
    ]
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/views/error/404.vue'),
    meta: {
      title: '页面不存在',
      showHeader: false,
      showInHeaderMenu: false,
      order: 999
    }
  },
  {
    path: '/login',
    name: '登录页面',
    component: () => import('@/views/Login.vue'),
    meta: {
      title: '登录页面',
      requiresAuth: false,
      showHeader: false,
      showInHeaderMenu: false,
      order: 999
    }
  }
]

export default routes
